package com.smart.campus.controller;

import com.smart.campus.dto.ShAsk;
import com.smart.campus.pojo.PagedResponse;
import com.smart.campus.pojo.ResponseResult;
import com.smart.campus.service.ShAskServiceFeign;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "请假管理")
@Slf4j
@RestController
@RequestMapping(value = "shAsk")
public class ShAskController {
    @Autowired
    private ShAskServiceFeign shAskServiceFeign;

    @ApiOperation(value = "请假查询",httpMethod = "POST",notes = "请假查询")
    @RequestMapping(value = "findAskList")
    public ResponseResult<List<ShAsk>> findAskList(){
        return new ResponseResult<>(200,"成功",shAskServiceFeign.findAskList());
    }
    @RequestMapping(value = "pageShAsk")
    public ResponseResult<PagedResponse<ShAsk>> pageShAsk(@RequestBody ShAsk shAsk, @RequestParam(value = "pageNum")Integer pageNum,@RequestParam(value = "pageSize")Integer pageSize){
        return new ResponseResult<>(200,"成功",shAskServiceFeign.pageShAsk(shAsk,pageNum,pageSize));
    }
}
